UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oxBycYbk2k4oGX+bkeZZh5dQgg3XFid0c6dhRI+xcYI='
WHERE
key_id = 'cfcc21691d2e4406f9f6abf04cf6198f1549292f5a65f6735d192d11249aa4db'
AND (
token = 'oxBycYbk2k4oGX+bkeZZh5dQgg3XFid0c6dhRI+xcYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)