UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QjwzDTGto2SqRF90ttmWa7Toiv0Wg0GXoTqibLRX3vU='
WHERE
key_id = '2732ed50fa439e7e591a98b6457908e8c4dfb105ccf0469a3d7c2f2a585bd804'
AND (
token = 'QjwzDTGto2SqRF90ttmWa7Toiv0Wg0GXoTqibLRX3vU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)