UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pdfV2/1PecIuDprApfhgnDn2e7TTE5Z8uivfYrrIWug=' 
WHERE 
  key_id = '8ca61584bd1a8b7658fb58ed96f13f93906e58e9ba7c38910bed72dac82ed619' 
  AND (
    token = 'pdfV2/1PecIuDprApfhgnDn2e7TTE5Z8uivfYrrIWug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042