UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wIlcuTgKpynMIBh8rQp52nj708DRZNQrtGmYvDCapcs=' 
WHERE 
  key_id = '42321918feaf05b5ae9ec0a207d58c0d15cd5ebf584642cf041fc9f3ac1d2894' 
  AND (
    token = 'wIlcuTgKpynMIBh8rQp52nj708DRZNQrtGmYvDCapcs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028