UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9RgNQM4w8sT/xUqWSqzHQqCt5fVHWjirGlRbyFC+oZA=' 
WHERE 
  key_id = 'c3ebdaf29ca3a08c82b4fd90dc782a869a18695f24e874b3a1a4af9e966e1a10' 
  AND (
    token = '9RgNQM4w8sT/xUqWSqzHQqCt5fVHWjirGlRbyFC+oZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043