UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dib6DAPG1B+m2x3FjjEyoCYdMgeW8b42aFdlCM0z7VE=' 
WHERE 
  key_id = '0d66801ccdf9ecc376d936ccf3f3e68275e0feff200f9c934ba23f10bf6afc4d' 
  AND (
    token = 'Dib6DAPG1B+m2x3FjjEyoCYdMgeW8b42aFdlCM0z7VE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023