UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bGD4aHq+WnkBI9LhMx4hkvFp4VqUVAx83snjz3JqHoY='
WHERE
key_id = '420d3a031149ee2744bf17396ccb190ebc75ca235b6576c2140a053bf723e2a0'
AND (
token = 'bGD4aHq+WnkBI9LhMx4hkvFp4VqUVAx83snjz3JqHoY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)