UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xvfOX/+NCzotjpffveBe9DBdz8OlKelmg2ijigXcNmI=' 
WHERE 
  key_id = '3c3e3dc6e6f1f04b5a93e05310506a5f0dd95d3ed6dff8c000a02ce0dae39ce9' 
  AND (
    token = 'xvfOX/+NCzotjpffveBe9DBdz8OlKelmg2ijigXcNmI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026