UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm3z28qc4yzumQIz4o3lIeRc9rjaxSXtpx7VsCb+iw4Q=' 
WHERE 
  key_id = 'de672d5df1e23537cbb05dbae80c2ace57aebc97c1dfdf2013800330b1da1b2e' 
  AND (
    token = 'm3z28qc4yzumQIz4o3lIeRc9rjaxSXtpx7VsCb+iw4Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021