UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dj5g0m9IYIV1DCVJ3+9+TUsGkp4/Y1v2Rku1PneRi0s='
WHERE
key_id = '55f6ef24f8abb3bea5ed12b72425cdee1335c204cbe5a5b8fd4ceb0ebdbb716e'
AND (
token = 'dj5g0m9IYIV1DCVJ3+9+TUsGkp4/Y1v2Rku1PneRi0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)