UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4SzK0m2rwvHjUTI+RfZAC5aQUD+flzAcfwJO0iAX1rU=' 
WHERE 
  key_id = '28a36ac7349e8b6f285e72f95a384972b465b16e67d06ede469732651dd1fe5d' 
  AND (
    token = '4SzK0m2rwvHjUTI+RfZAC5aQUD+flzAcfwJO0iAX1rU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067