UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3TmvVuKivmhSulycclMymd2EQn+ER2qlQzBlEKxEBws=' 
WHERE 
  key_id = '83433d37c05eef6e5229bf5d720d2163ae34cef0cbde77d8522719e64886d6b7' 
  AND (
    token = '3TmvVuKivmhSulycclMymd2EQn+ER2qlQzBlEKxEBws=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035