UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JmPT8cbJwU2t790ef4jsSaHBZPa1aWnzbZbmhwN+nT0='
WHERE
key_id = '53e49c5fee32d3ab8286d21730cb1f3e68aade212f89e27f2cdec1c3b044ff5e'
AND (
token = 'JmPT8cbJwU2t790ef4jsSaHBZPa1aWnzbZbmhwN+nT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)