UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9oL6GWC7Kerg+LiyxpW1s3sY81xYK3KvQDBHlCpLGmY=' 
WHERE 
  key_id = '35aa2153cc780c5674168aa63b5ad9a013435251204fd2e2e82843c348d5f320' 
  AND (
    token = '9oL6GWC7Kerg+LiyxpW1s3sY81xYK3KvQDBHlCpLGmY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038