UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5xZbhxbgh28/kIhz2wqLIIuiMEYtF9ZvuysiTyjW+Tk='
WHERE
key_id = '05158e002e276fcbc7259cb2c1293376b5583f4224bf46c6b7e1e258fb5866e5'
AND (
token = '5xZbhxbgh28/kIhz2wqLIIuiMEYtF9ZvuysiTyjW+Tk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)