UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'chEBx7au25QQbwHidjJontGKX7aJFKap3QT/jx6a3b0='
WHERE
key_id = '6dab8adc67afcd0016ae3fc98e3bbb5767c8f8815dc15b26e9385740b1074a59'
AND (
token = 'chEBx7au25QQbwHidjJontGKX7aJFKap3QT/jx6a3b0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)