UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9rEjpAjyaNWiIS0XVYXwWifwjN61IBcRcisR5YgXz9I='
WHERE
key_id = '2837032caec234d9a7952e7f5303805cb84ea5c95fdfb14aaf7e42dff09a9306'
AND (
token = '9rEjpAjyaNWiIS0XVYXwWifwjN61IBcRcisR5YgXz9I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)