UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pncg+vaeCij4Fg5OtqbfUeB+5TYnqLJGf0DIcTJSTjM='
WHERE
key_id = '4a8a08988d5fd6abe4f0ac223e30bf971ea8797fb9af51424d7d3646c1f937ff'
AND (
token = 'Pncg+vaeCij4Fg5OtqbfUeB+5TYnqLJGf0DIcTJSTjM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)