UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Zc2zGc93PUJqXuAjxlk5LWRTBAMjxuFVYhfrMdGe7M=' 
WHERE 
  key_id = '0ae6a9eac3b24d79ea4cb197ddd072b20db59b827bfe176df25332e9a80be065' 
  AND (
    token = '1Zc2zGc93PUJqXuAjxlk5LWRTBAMjxuFVYhfrMdGe7M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018