UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/gb/TIlc4fbvpcPCV8fWRJf+tHTrH++H5AmBsCFh9Sk=' 
WHERE 
  key_id = 'ff7aa71f9af22d26b256cca2a15f6af74283d91599507795764cdb6f0d7745e5' 
  AND (
    token = '/gb/TIlc4fbvpcPCV8fWRJf+tHTrH++H5AmBsCFh9Sk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00132