UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fKvLmvKQ9KmPZTgMOzIlrAWk/XT2kCXLTuu8+k30H64=' 
WHERE 
  key_id = '0872d69235e9a3dd6e28c0665986cb593ae019d1e81eb76216d289a3fd82f733' 
  AND (
    token = 'fKvLmvKQ9KmPZTgMOzIlrAWk/XT2kCXLTuu8+k30H64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023