UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WcXKDpbOr8AFmShV6wOnbSMYaf5Tg1YAns55kajn0uU=' 
WHERE 
  key_id = 'fd5dfd2065ed8443b20582ecef99d0e28479cf6dd9db1e7c17ff7c6b0c92d534' 
  AND (
    token = 'WcXKDpbOr8AFmShV6wOnbSMYaf5Tg1YAns55kajn0uU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076