UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ua///UScaXaF6+E7bn8TouVeYa2yWOpR0faFafjjOBE='
WHERE
key_id = '7d8e65ff20d959ddeba6eb5aa054d52f266ac474113408403108a44e56e1bc60'
AND (
token = 'ua///UScaXaF6+E7bn8TouVeYa2yWOpR0faFafjjOBE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)