UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lB1OfZgW7QdjE0wPifyNljUDOYh94ZFTstqoGjlTeMA=' 
WHERE 
  key_id = '3fd3ec0eb361c8dda906291a94a7f2a6511d000f61759f91aff308c034c11875' 
  AND (
    token = 'lB1OfZgW7QdjE0wPifyNljUDOYh94ZFTstqoGjlTeMA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022