UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'acAHdkQoyhS9xThDQwlI+6dVBJzqvi/15oYrx6vT1AU='
WHERE
key_id = '03dd9e808793b6ee7a2a6926d51e7dc0e9442a9e86fdd5bfb30124f6c1e3616c'
AND (
token = 'acAHdkQoyhS9xThDQwlI+6dVBJzqvi/15oYrx6vT1AU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)