UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fTthOCWf0g+sjbULTdUGXXkr7or1xNcw+T2Kl/OZj6A='
WHERE
key_id = 'fec533e5a5eab8d932dccb316364e7c8946b506dfbe783a10e9469a786f0a8ca'
AND (
token = 'fTthOCWf0g+sjbULTdUGXXkr7or1xNcw+T2Kl/OZj6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)