UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2BGo3zH7E/O4G+W/cX/AY1P45PeA3euY3B+3a9mLtbQ='
WHERE
key_id = 'ac864a9dafa5d862f6a98d6799e00212e7d5859137af7af55696cd553f199589'
AND (
token = '2BGo3zH7E/O4G+W/cX/AY1P45PeA3euY3B+3a9mLtbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)