UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y8M1RsWL5HvqQ7knPjt5xkmkz+SKa5qW5Jt/je22yYk=' 
WHERE 
  key_id = '70dec4b44c618c97c871b9952f8e22fbae9f1cb57677e6001a13eafd9bace485' 
  AND (
    token = 'Y8M1RsWL5HvqQ7knPjt5xkmkz+SKa5qW5Jt/je22yYk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016