UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'llXB0WD93yWKT5K4jU/9tnQr8mBzEcmAcOwDAalwg5o='
WHERE
key_id = '491f584c6ba465c5766c8096df5b7acfec87a9c05f36bc373da61c89088d82c5'
AND (
token = 'llXB0WD93yWKT5K4jU/9tnQr8mBzEcmAcOwDAalwg5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)