UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4qZexq0OaDWw6tV2aJJK++HX8BQWM/Xor7jpuDL5P8='
WHERE
key_id = '9c94158a68f7f5a720a19c3bf56b524f920af8538a6a478978e5dbdba6cb81bc'
AND (
token = '+4qZexq0OaDWw6tV2aJJK++HX8BQWM/Xor7jpuDL5P8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)