UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fxri7tF0w72cFLS+rui9WWk0zZIjDuf3N1EsJlys8iw=' 
WHERE 
  key_id = 'e050f22ba5205f6e9be0d67da5b48e2ca828f4df0ba75ace9d66e8c7dc61ab04' 
  AND (
    token = 'fxri7tF0w72cFLS+rui9WWk0zZIjDuf3N1EsJlys8iw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030