UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6EoErnibF40uklsg8UtdMKqXnVzLYCt/DSMgRO2XhBU=' 
WHERE 
  key_id = '25a73f95acc5d2f7f7900fad771012a42c508e97e4b53e5a326843385a513fe3' 
  AND (
    token = '6EoErnibF40uklsg8UtdMKqXnVzLYCt/DSMgRO2XhBU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050