UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qLVDV/wCt5CekQTb883Qvd40Kn4y8kv/0W7RD6ZnIwU='
WHERE
key_id = '4c2a4f03c02c894d4f1939b5cd53593ff7242396c886e877a21a0e5ba9bd70f3'
AND (
token = 'qLVDV/wCt5CekQTb883Qvd40Kn4y8kv/0W7RD6ZnIwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)