UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k7mm8I+4xQ9euML4MaXkb0EQ/oy3tgCyI8wbaswMBDg='
WHERE
key_id = '7f0175d647c9160bba7a887b9c09e004eda499aab89de589114826452d6a827b'
AND (
token = 'k7mm8I+4xQ9euML4MaXkb0EQ/oy3tgCyI8wbaswMBDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)