UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9xj/iqLW/PlPJfMhT/1Hdq2dxYjvS4iYVwyVHBzO3hs='
WHERE
key_id = 'afebe362bab7af6c9333981b24dd6f5423648e95cbf0462cf70c71b954bef2e8'
AND (
token = '9xj/iqLW/PlPJfMhT/1Hdq2dxYjvS4iYVwyVHBzO3hs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)