UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8CSUJ3gzSvkTd8g5Gpp4eQtRdSXHbLY+YpnOYVeaiMc=' 
WHERE 
  key_id = 'a7c9b316a8fa2558379e9a1e770a201df5f09d3eca6fe0fc8b0823a4fb0b6d26' 
  AND (
    token = '8CSUJ3gzSvkTd8g5Gpp4eQtRdSXHbLY+YpnOYVeaiMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019