UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QWTYu1Gsh8Vi9YfcEcTN/rH7m/2TvR9JJYw6qT+O+D8=' 
WHERE 
  key_id = '9383f5cd074ca289a7ad573ee041eaf15f1ef31dccd47e6d537a9b58f4f5850a' 
  AND (
    token = 'QWTYu1Gsh8Vi9YfcEcTN/rH7m/2TvR9JJYw6qT+O+D8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054