UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ITO2JO1GuP70lMCEgw9Z1W1Cjh0gFLdGpVLsnsG2CVg=' 
WHERE 
  key_id = 'ed3bbad46bc51c8ac9d9d7e1b45a13fab203d205b2354773cc915333aed63f60' 
  AND (
    token = 'ITO2JO1GuP70lMCEgw9Z1W1Cjh0gFLdGpVLsnsG2CVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024