UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tP/xZE6WsSfvfSth6NG/34t/8iEN+4ve3c1J/G53S4s='
WHERE
key_id = '4aade6740bf1f4be0950a2bc4b4b06c491bcc3ffdf552d09485a9dc8045334e5'
AND (
token = 'tP/xZE6WsSfvfSth6NG/34t/8iEN+4ve3c1J/G53S4s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)