UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cOkZIR7XvTn0nKDEriNhIL7Ad+1nqQ1kYdtLu9CfpPM=' 
WHERE 
  key_id = '2a493cde675eff4c6cba4ff2107bf94ffcf552ab201afb0141e7a58e8c2e072c' 
  AND (
    token = 'cOkZIR7XvTn0nKDEriNhIL7Ad+1nqQ1kYdtLu9CfpPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086