UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o/im1SdpMkpfbX3W4vYWQRFv5kZV1vWy0zNH8gB1oNg='
WHERE
key_id = 'b1dac8c8d1f232ba038be0930e2ea04429c501f5bbde0dac7e76bd4f62b1c6f0'
AND (
token = 'o/im1SdpMkpfbX3W4vYWQRFv5kZV1vWy0zNH8gB1oNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)