UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm9x/XcrylfODqRb7v7R0Qo7StFR6XvmeifCR/Yd8N/I=' 
WHERE 
  key_id = 'f6e46569941e5c0889e4b969a0ea50d6c614f38af208187588f66dcfc7cf57f7' 
  AND (
    token = 'm9x/XcrylfODqRb7v7R0Qo7StFR6XvmeifCR/Yd8N/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042