UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PZYKiqe3bkktFUtd44/EGH2bU2QliGAYJV7mLtcV0CU='
WHERE
key_id = '7b27a1b759506505b04e57c64b4fe4e25a967ac3b5f455ff95c38a6bc3398088'
AND (
token = 'PZYKiqe3bkktFUtd44/EGH2bU2QliGAYJV7mLtcV0CU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)