UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JH4WUtdY6zvS+IeHW0conIR4MlLDWdDszb2HwcAw7dM=' 
WHERE 
  key_id = '9edf0dc50ade91357facd8b7d2b870702fd23a496ef3c5597b0674197cef4d02' 
  AND (
    token = 'JH4WUtdY6zvS+IeHW0conIR4MlLDWdDszb2HwcAw7dM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036