UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M4UBLvTylxy8wMad/X93PukP7GC08GBVN3mTnapJlyU=' 
WHERE 
  key_id = 'e282cc72b9f309053eb8cfcbc5a1f286400b10a7b21fc42ad5b2156c723df2ae' 
  AND (
    token = 'M4UBLvTylxy8wMad/X93PukP7GC08GBVN3mTnapJlyU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025