UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '98VKZoLBpeMi71ZAX4hh/Sbgjhihnodb3dqEIIW9syw='
WHERE
key_id = 'dc8d03fc11a9c49d3f023cea5a23cd313dca4284da0bd0cf1b800a713669e603'
AND (
token = '98VKZoLBpeMi71ZAX4hh/Sbgjhihnodb3dqEIIW9syw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)