UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bGK5jjGRBtmefF4TUzMrHhb//sAE+tu+RKXoYOESZNU='
WHERE
key_id = '66655d67fdd74fe85edabe3f7ccbb98b5c575f7d95e9b877caf073046db5bf1f'
AND (
token = 'bGK5jjGRBtmefF4TUzMrHhb//sAE+tu+RKXoYOESZNU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)