UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3aKjHzPEEsxoUOoFu1E4xoHoIqxMr5jUGPtxkfFnV9g=' 
WHERE 
  key_id = '097db265c46e6b1c6da2fd03d3d76da4065feb34f8e9f20c29bd74e94fbadb7a' 
  AND (
    token = '3aKjHzPEEsxoUOoFu1E4xoHoIqxMr5jUGPtxkfFnV9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035