UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bBbH1+PGKxdE210jrGQFyAjvWWpQahO6C6willPz97A='
WHERE
key_id = 'e1f626b4db6f9cafde2f7340440e4dc1e64d392beb17807f3220db5de5e0e210'
AND (
token = 'bBbH1+PGKxdE210jrGQFyAjvWWpQahO6C6willPz97A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)