UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JW14YtGS3EnVboSsBQCCnL59PSOzC1og+WM1XhWx0k8='
WHERE
key_id = '2bcd83f889cb4b31c4aeedc0b3619f21bb96e0ec6186ee9ec48b18e73e10bac0'
AND (
token = 'JW14YtGS3EnVboSsBQCCnL59PSOzC1og+WM1XhWx0k8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)