UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WSecj+VGwwNiZZJpDQjbpW3FaNzPNW/cr6Pu3gw45UU='
WHERE
key_id = '6ead1c54ad6cbb9ce37e25853e0423ad8b601de6201e78ee9946639eb86a6662'
AND (
token = 'WSecj+VGwwNiZZJpDQjbpW3FaNzPNW/cr6Pu3gw45UU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)