UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3dSmrjFW43GTO17/J3eTrg/LfbMpQkMUosbLJc1ulfQ=' 
WHERE 
  key_id = 'dd6d00eaeabf39b63ab4bc637e67721c1287dea52bfd3fdd97af8d5478851f91' 
  AND (
    token = '3dSmrjFW43GTO17/J3eTrg/LfbMpQkMUosbLJc1ulfQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032